#include //Chip name : WA20-6829B-A //Initial Saved Chip Number : #1 const INIT_STRUCT section0[] = { 0x0B, 0x01, // Soft Reset contorl 0x02, 0x00, // MCLK ( 48k = 0x00, 96k = 0x01, 36k=0x02 ) 0x33, 0x03, // Soft Mute On Control 0x7E, 0x03, // Enable coefficient write for ch1/ch2 }; const COEFFICIENT_STRUCT section1[] = { //DRC Coefficients 0x32, 0x11000000, 0x33, 0x20000000, 0x34, 0x20000000, 0x35, 0x20000000, 0x36, 0x20000000, 0x37, 0x11000000, 0x38, 0x20000000, 0x39, 0x20000000, 0x3A, 0x20000000, 0x3B, 0x20000000, 0x3C, 0x11000000, 0x3D, 0x20000000, 0x3E, 0x20000000, 0x3F, 0x20000000, 0x40, 0x20000000, 0x41, 0x11000000, 0x42, 0x20000000, 0x43, 0x20000000, 0x44, 0x20000000, 0x45, 0x20000000, 0x46, 0x11000000, 0x47, 0x20000000, 0x48, 0x20000000, 0x49, 0x20000000, 0x4A, 0x20000000, 0x4B, 0x11000000, 0x4C, 0x20000000, 0x4D, 0x20000000, 0x4E, 0x20000000, 0x4F, 0x20000000, }; const INIT_STRUCT section2[] = { 0x7E, 0x00, // Disable coefficient write for ch1/ch2 0x33, 0x00, // Soft Mute Off Control/ch2 0x20, 0x00, // Low band DRC threshold = 0.5 dB 0x21, 0x01, // DRC Low Band Attack = 8 msec, Release = 0.5 sec 0x22, 0x00, // High band DRC threshold = 0.5 dB 0x23, 0x01, // DRC High Band Attack = 8 msec, Release = 0.5 sec 0x26, 0x00, // Post band DRC threshold = 0.5 dB 0x27, 0x41, // DRC Post Band Attack = 8 msec, Release = 0.025 sec 0x2A, 0x6A, // Sub band DRC threshold = 0.5 dB 0x2B, 0x01, // DRC Sub Band Attack = 8 msec, Release = 0.5 sec 0x29, 0x00, // DRC 2Band : Disabled 0x2C, 0x00, // Sub Band Disabled 0x17, 0x9F, // channel 1 vol = 0.0 dB 0x18, 0x9F, // channel 2 vol = 0.0 dB 0x43, 0x02, // PWM output mode = DBTL(Ternary) 0x3C, 0x64, // Prescaler Value CH12 0x33, 0x03, // Soft Mute On Control/ch2 0x7E, 0x03, // Enable coefficient write for ch1/ch2 }; const COEFFICIENT_STRUCT section3[] = { // BQ Coefficients 0x00, 0x11000000, 0x01, 0x20000000, 0x02, 0x20000000, 0x03, 0x20000000, 0x04, 0x20000000, 0x05, 0x11000000, 0x06, 0x20000000, 0x07, 0x20000000, 0x08, 0x20000000, 0x09, 0x20000000, 0x0A, 0x11000000, 0x0B, 0x20000000, 0x0C, 0x20000000, 0x0D, 0x20000000, 0x0E, 0x20000000, 0x0F, 0x11000000, 0x10, 0x20000000, 0x11, 0x20000000, 0x12, 0x20000000, 0x13, 0x20000000, 0x14, 0x11000000, 0x15, 0x20000000, 0x16, 0x20000000, 0x17, 0x20000000, 0x18, 0x20000000, 0x19, 0x11000000, 0x1A, 0x20000000, 0x1B, 0x20000000, 0x1C, 0x20000000, 0x1D, 0x20000000, 0x1E, 0x11000000, 0x1F, 0x20000000, 0x20, 0x20000000, 0x21, 0x20000000, 0x22, 0x20000000, 0x23, 0x11000000, 0x24, 0x20000000, 0x25, 0x20000000, 0x26, 0x20000000, 0x27, 0x20000000, 0x28, 0x11000000, 0x29, 0x20000000, 0x2A, 0x20000000, 0x2B, 0x20000000, 0x2C, 0x20000000, 0x2D, 0x11000000, 0x2E, 0x20000000, 0x2F, 0x20000000, 0x30, 0x20000000, 0x31, 0x20000000, 0x5C, 0x11000000, 0x5D, 0x20000000, 0x5E, 0x20000000, 0x5F, 0x20000000, 0x60, 0x20000000, 0x61, 0x11000000, 0x62, 0x20000000, 0x63, 0x20000000, 0x64, 0x20000000, 0x65, 0x20000000, 0x66, 0x11000000, 0x67, 0x20000000, 0x68, 0x20000000, 0x69, 0x20000000, 0x6A, 0x20000000, 0x6B, 0x11000000, 0x6C, 0x20000000, 0x6D, 0x20000000, 0x6E, 0x20000000, 0x6F, 0x20000000, 0x70, 0x11000000, 0x71, 0x20000000, 0x72, 0x20000000, 0x73, 0x20000000, 0x74, 0x20000000, 0x75, 0x11000000, 0x76, 0x20000000, 0x77, 0x20000000, 0x78, 0x20000000, 0x79, 0x20000000, }; const INIT_STRUCT section4[] = { 0x7E, 0x08, // Enable APEQ settings }; const COEFFICIENT_STRUCT section5[] = { // APEQ Coefficients 0x00, 0x10000000, 0x01, 0x10000000, 0x02, 0x10000000, 0x03, 0x10000000, 0x04, 0x10000000, 0x05, 0x10000000, 0x06, 0x11000000, 0x07, 0x11000000, 0x08, 0x11000000, 0x09, 0x11000000, 0x0A, 0x11000000, 0x0B, 0x11000000, 0x0C, 0x11000000, 0x0D, 0x11000000, 0x0E, 0x11000000, 0x0F, 0x11000000, 0x10, 0x11000000, 0x11, 0x11000000, 0x12, 0x20000000, 0x13, 0x20000000, 0x14, 0x20000000, 0x15, 0x20000000, 0x16, 0x20000000, 0x17, 0x20000000, 0x1F, 0x11000000, 0x20, 0x11000000, 0x21, 0x11000000, 0x22, 0x11000000, 0x23, 0x11000000, 0x24, 0x11000000, }; const INIT_STRUCT section6[] = { 0x7E, 0x00, // Disable coefficient write for ch1/ch2 0x33, 0x00, // Soft Mute Off Control/ch2 0x19, 0x00, // APEQ Path Option 0x1A, 0x00, // APEQ1: Attack = 2 msec, Release = 0.5 sec 0x1B, 0x00, // APEQ2: Attack = 2 msec, Release = 0.5 sec 0x1C, 0x00, // APEQ3: Attack = 2 msec, Release = 0.5 sec 0x1D, 0x00, // APEQ4: Attack = 2 msec, Release = 0.5 sec 0x1E, 0x00, // APEQ5: Attack = 2 msec, Release = 0.5 sec 0x1F, 0x00, // APEQ6: Attack = 2 msec, Release = 0.5 sec 0x0E, 0x00, // CH1 BQ1 ~ BQ3 Enable 0x0F, 0x00, // CH2 BQ1 ~ BQ3 Enable 0x10, 0x00, // CH1 BQ4 ~ BQ6 Enable 0x11, 0x00, // CH2 BQ4 ~ BQ6 Enable 0x12, 0x00, // CH1 BQ7 ~ BQ10 Enable 0x13, 0x00, // CH2 BQ7 ~ BQ10 Enable 0x14, 0x00, // CH1 BQ11 ~ BQ12 Enable 0x15, 0x00, // CH2 BQ11 ~ BQ12 Enable 0x68, 0x60, // Phase Control PWM Phase = 90.00 degree 0x38, 0x0B, // Protect control Hold time = 4 msec, Restore th = 5, Interval ratio = 2 0x41, 0x1A, // Minimum Pulse Width = 40ns 0x24, 0x00, // RS DRC : Vrms Disabled 0x25, 0x0A, // Vrms Period for Low - Band = 1.0 ms 0x4D, 0x0A, // Vrms Period for High - Band = 1.0 ms 0x4E, 0x0A, // Vrms Period for Sub - Band = 1.0 ms 0x4F, 0x0A, // Vrms Period for Post - Band = 1.0 ms 0x2D, 0x0A, // Threshold Table Mapping = 2.0 0x07, 0x00, // Enabled RS Band : {} }; const INIT_STRUCT section7[] = { //Only use ON PBTL MODE }; const INIT_STRUCT section8[] = { 0x3D, 0x00, // WCK Synchronizing Control 0x0C, 0xFF, // Master volume Control 0x16, 0x00, // Master Fine Volume : 0 dB 0x35, 0x04, //Reset the Auto_PWM_MASK_restore_counter to 0, PWM MASK output is high 0x34, 0x00, // PWM switching on 0x33, 0x00, // soft-mute off (increase Volume) }; void Init(void) { ExportC_write1byte(getArgument(section0)); ExportC_write4byte(getArgument(section1)); ExportC_write1byte(getArgument(section2)); ExportC_write4byte(getArgument(section3)); ExportC_write1byte(getArgument(section4)); ExportC_write4byte(getArgument(section5)); ExportC_write1byte(getArgument(section6)); ExportC_write1byte(getArgument(section7)); ExportC_write1byte(getArgument(section8)); };